﻿<Window 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="DockPanel Sample"
  Width="300"
  Height="300">
  <!-- LastChildFillをFalseにすると残りの空間が埋まらない状態となる。既定値はTrue. -->
  <DockPanel LastChildFill="True">
    <Button
      Content="Button 1"
      DockPanel.Dock="Top">
    </Button>
    
    <Button
      Content="Button 2"
      DockPanel.Dock="Left">
    </Button>
    
    <Button
      Content="Button 3"
      DockPanel.Dock="Bottom">
    </Button>
    
    <Button
      Content="Button 4"
      DockPanel.Dock="Right">
      
      <Button.BorderBrush>
        Blue
      </Button.BorderBrush>
    </Button>
    
    <!-- Last Child -->
    <Grid>
      <TextBox TextWrapping="Wrap"
               AcceptsReturn="True"
               ScrollViewer.VerticalScrollBarVisibility="Auto">
      </TextBox>
    </Grid>
  </DockPanel>
</Window>